/*
 *	Copyright (c) 2009 Queensland University of Technology. All rights reserved.
 *	The QUT Bioinformatics Collection is open source software released under the 
 *	Microsoft Public License (Ms-PL): http://www.microsoft.com/opensource/licenses.mspx.
 */
using System.Web;
using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration;
using DotNetOpenAuth.OpenId.RelyingParty;

namespace QUT.Bio.Web {
	/// <summary>
	/// Strong-typed bag of session state.
	/// </summary>
	public class LoginState {
		public static void Clear () {
			ProfileFields = null;
			FriendlyLoginName = null;
			AuthenticationResponse = null;
		}

		public static ClaimsResponse ProfileFields {
			get {
				return HttpContext.Current.Session["ProfileFields"] as ClaimsResponse;
			}

			set {
				HttpContext.Current.Session["ProfileFields"] = value;
			}
		}

		public static IAuthenticationResponse AuthenticationResponse {
			get {
				return HttpContext.Current.Session["AuthenticationResponse"] as IAuthenticationResponse;
			}

			set {
				HttpContext.Current.Session["AuthenticationResponse"] = value;
			}
		}
		public static string FriendlyLoginName {
			get {
				return HttpContext.Current.Session["FriendlyUsername"] as string;
			}

			set {
				HttpContext.Current.Session["FriendlyUsername"] = value;
			}
		}


	}
}